package selfview.sufutian.com.myapplication;

import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import selfview.sufutian.com.myapplication.draw2d.TaiJiView;

/**
 * Created by sufutian on 2017/1/5.
 */

public class My2dDrawActivity extends Activity {


    private TaiJiView taijiView;

    public static void toActivity(Activity activity) {
        Intent intent = new Intent(activity, My2dDrawActivity.class);
        activity.startActivity(intent);

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.taiji_activity);

        rotaAnimi(taijiView);
//        CircleImage circle = (CircleImage) findViewById(R.id.circle);
//        Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.image_1);
//        circle.init(bitmap);
//        circle.invalidate();

        initView();
    }

    public void rotaAnimi(View view) {
        ObjectAnimator animi = ObjectAnimator.ofFloat(view, "rotation", 0, 360);
        animi.setDuration(1000);
        animi.start();

    }

    private void initView() {
        taijiView = (TaiJiView) findViewById(R.id.taiji_view);
    }
}
